import { createRouter, createWebHashHistory } from 'vue-router'

const router = createRouter({
  history: createWebHashHistory(),
  routes: [

    {
      path: '/login',
      name: 'Login',
      // route level code-splitting
      // this generates a separate chunk (about.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: () => import(/* webpackChunkName: "about" */ '../views/login.vue'),
      meta:{
        keepAlive: false,
      }
    },
    {
      path: '/',
      name: 'Weibo',
      // route level code-splitting
      // this generates a separate chunk (about.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: () => import(/* webpackChunkName: "about" */ '../views/weibo.vue'),
      meta:{
        keepAlive: true,
      }
    }
    ,
    {
      path: '/addWeibo',
      name: 'AddWeibo',
      // route level code-splitting
      // this generates a separate chunk (about.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: () => import(/* webpackChunkName: "about" */ '../views/addWeibo.vue')
      ,
      meta:{
        keepAlive: false,
      }
    }  ,
    {
      path: '/home',
      name: 'Home',
      // route level code-splitting
      // this generates a separate chunk (about.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: () => import(/* webpackChunkName: "about" */ '../views/Home.vue')
      ,
      meta:{
        keepAlive: true,
      }
    },
    {
      path: '/changePassword',
      name: 'ChangePassword',
      // route level code-splitting
      // this generates a separate chunk (about.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: () => import(/* webpackChunkName: "about" */ '../views/changePs.vue')
      ,
      meta:{
        keepAlive: false,
      }
    }  ,
    // {
    //   path: '/infoEdit',
    //   name: 'infoEdit',
    //   // route level code-splitting
    //   // this generates a separate chunk (about.[hash].js) for this route
    //   // which is lazy-loaded when the route is visited.
    //   component: () => import(/* webpackChunkName: "about" */ '../views/infoEdit.vue')
    // },
    // {
    //   path: '/wbdetail',
    //   name: 'wbdetail',
    //   // route level code-splitting
    //   // this generates a separate chunk (about.[hash].js) for this route
    //   // which is lazy-loaded when the route is visited.
    //   component: () => import(/* webpackChunkName: "about" */ '../views/weiboDetail.vue')
    // },
    // {
    //   path: '/test',
    //   name: 'test',
    //   // route level code-splitting
    //   // this generates a separate chunk (about.[hash].js) for this route
    //   // which is lazy-loaded when the route is visited.
    //   component: () => import(/* webpackChunkName: "about" */ '../views/test.vue')
    // }
  ],
})

export default router
